
/*!
	\file
	\brief Goods.

		\author Igor Mironchik (igor.mironchik at gmail dot com).

		Copyright (c) 2010 - 2011 Igor Mironchik

	Permission is hereby granted, free of charge, to any person
	obtaining a copy of this software and associated documentation
	files (the "Software"), to deal in the Software without
	restriction, including without limitation the rights to use,
	copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the
	Software is furnished to do so, subject to the following
	conditions:

	The above copyright notice and this permission notice shall be
	included in all copies or substantial portions of the Software.

	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
	EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
	OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
	NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
	HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
	FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
	OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef ESHOPHELPER__GOODS_HPP__INCLUDED
#define ESHOPHELPER__GOODS_HPP__INCLUDED

// Qt include.
#include <QtCore/QString>
#include <QtCore/QMetaType>


namespace eShopHelper {

//
// Goods
//

//! Goods'es description.
class Goods {
public:
	//! Currency type.
	enum Currency {
		//! Not defined currency.
		Undefined = 0,
		//! US dollars.
		USD = 1,
		//! Euro.
		EURO = 2,
		//! RU rubles.
		RU = 3,
		//! BY rubles.
		BY = 4
	}; // enum Currency

	Goods();

	Goods( const QString & name,
		const QString & description,
		Currency currency,
		double price,
		double vat,
		bool isWithVAT );

	//! \return Name of the goods.
	const QString & name() const;

	//! \return Description of the goods.
	const QString & description() const;

	//! \return Currency type.
	Currency currency() const;

	//! \return Price of the goods.
	double price() const;

	//! \return Is price with VAT?
	bool isPriceWithVAT() const;

	//! \return true if goods details set correctly or false if otherwise.
	bool isGoods() const;

	//! \return VAT value.
	double vat() const;

	//! \return Image's file name.
	const QString & imageFileName() const;

	//! Set image's file nmae.
	void setImageFileName( const QString & fileName );

	//! \return Is image was set?
	bool isWithImage() const;

private:
	//! Name of the goods.
	QString m_name;
	//! Description of the goods.
	QString m_description;
	//! Currency type.
	Currency m_currency;
	//! Price of the goods.
	double m_price;
	//! Is price with VAT?
	bool m_isPriceWithVAT;
	//! VAT value.
	double m_vat;
	//! Image's file name.
	QString m_imageFileName;
}; // class Goods

} /* namespace eShopHelper */

Q_DECLARE_METATYPE( eShopHelper::Goods )

#endif // ESHOPHELPER__GOODS_HPP__INCLUDED
